package com.ft.oa.enums;

/**
 * 是否 0 否 1是
 *
 * @author liyansheng
 * @ClassName TenderResult
 * @date 2022-1-10 10:48:05
 */
public enum YesOrNoEnum
{

    YES("1", "是"),
    NO("0", "否");

    //名称
    private String name;
    //编码
    private String code;

    //构造函数
    YesOrNoEnum(String code, String name)
    {
        this.code = code;
        this.name = name;
    }

    public String getCode()
    {
        return code;
    }

    public String getName()
    {
        return name;
    }

    /**
     * 获取名称
     *
     * @param code
     * @return
     */
    public static String getByCode(String code)
    {
        for (YesOrNoEnum value : YesOrNoEnum.values())
        {
            if (value.code == code)
            {
                return value.name;
            }
        }
        return "";
    }
}
